package com.kotlin.android.platoon.app.provider

import android.app.Activity
import com.alibaba.android.arouter.facade.annotation.Route
import com.android.app.router.path.RouterProviderPath
import com.android.app.router.provider.IMainProvider

/**
 * app主入口模块
 *
 */
@Route(path = RouterProviderPath.Provider.PROVIDER_MAIN)
class MainProvider : IMainProvider {


    override fun showUpgradeDialog(
        title: String,
        content: String,
        downloadUrl: String,
        isNecessary: Boolean,
    ) {
    }

    private fun toUpgrade(activity: Activity, downloadUrl: String) {
//        val apkUpdateDialog = ApkUpdateDialog(activity)
//        apkUpdateDialog.show()
//        DownLoadUtils.downLoadApk(
//            activity,
//            downloadUrl,
//            object : Callback<Any>() {
//                override fun onResponse(response: Any?, id: Int) {
//                    val path = "${FileCache.PATH_FILE_DOWN}update.apk"
//                    activity.runOnUiThread {
//                        InstallUtils.installAPK(activity, path, null)
//                        apkUpdateDialog.dismiss()
//                    }
//                }
//
//                override fun onProgress(progress: Int) {
//                    super.onProgress(progress)
//                    activity.runOnUiThread {
//                        apkUpdateDialog.setProgress(progress)
//                    }
//                }
//
//            })
    }

}